#ifndef MINIBASIC_IMPL_FACTORY_H
#define MINIBASIC_IMPL_FACTORY_H

#pragma once

#include "stdafx.h"
#include <unknwn.h>

class MiniImplFactory : public IClassFactory
{
    LONG refCount;
    
public:
    MiniImplFactory();
    ~MiniImplFactory();

    // IUnknown
    STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppv);
    STDMETHODIMP_(ULONG) AddRef();
    STDMETHODIMP_(ULONG) Release();

    // IClassFactory
    STDMETHODIMP CreateInstance(IUnknown* pUnk, REFIID riid, LPVOID* ppv);
    inline STDMETHODIMP LockServer(BOOL bLock) {bLock ? AddRef() : Release(); return S_OK;}
};

#endif
